package com.ruoyi.hotel.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hotel.mapper.HlDeviceMapper;
import com.ruoyi.hotel.domain.HlDevice;
import com.ruoyi.hotel.service.IHlDeviceService;

/**
 * 酒店设备Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-10
 */
@Service
public class HlDeviceServiceImpl implements IHlDeviceService 
{
    @Autowired
    private HlDeviceMapper hlDeviceMapper;

    /**
     * 查询酒店设备
     * 
     * @param id 酒店设备主键
     * @return 酒店设备
     */
    @Override
    public HlDevice selectHlDeviceById(Long id)
    {
        return hlDeviceMapper.selectHlDeviceById(id);
    }

    /**
     * 查询酒店设备列表
     * 
     * @param hlDevice 酒店设备
     * @return 酒店设备
     */
    @Override
    public List<HlDevice> selectHlDeviceList(HlDevice hlDevice)
    {
        return hlDeviceMapper.selectHlDeviceList(hlDevice);
    }

    /**
     * 新增酒店设备
     * 
     * @param hlDevice 酒店设备
     * @return 结果
     */
    @Override
    public int insertHlDevice(HlDevice hlDevice)
    {
        hlDevice.setCreateTime(DateUtils.getNowDate());
        return hlDeviceMapper.insertHlDevice(hlDevice);
    }

    /**
     * 查询所有设备列表
     *
     * @return 所有设备
     */
    @Override
    public List<HlDevice> selectAllDevice() {

        return hlDeviceMapper.selectHlDeviceList(new HlDevice());

    }


    /**
     * 修改酒店设备
     * 
     * @param hlDevice 酒店设备
     * @return 结果
     */
    @Override
    public int updateHlDevice(HlDevice hlDevice)
    {
        hlDevice.setUpdateTime(DateUtils.getNowDate());
        return hlDeviceMapper.updateHlDevice(hlDevice);
    }

    /**
     * 批量删除酒店设备
     * 
     * @param ids 需要删除的酒店设备主键
     * @return 结果
     */
    @Override
    public int deleteHlDeviceByIds(Long[] ids)
    {
        return hlDeviceMapper.deleteHlDeviceByIds(ids);
    }

    /**
     * 删除酒店设备信息
     * 
     * @param id 酒店设备主键
     * @return 结果
     */
    @Override
    public int deleteHlDeviceById(Long id)
    {
        return hlDeviceMapper.deleteHlDeviceById(id);
    }
}
